@extends('admin.master')

@section('css')
    <meta name="csrf-token" content="{{ csrf_token() }}">
    @stop

    @section('page_header')
    <h1 class="page-title">
        <i class="voyager-sound"></i>公司公告
    </h1>
    @stop

    @section('content')
    <div class="page-content container-fluid">
        <div class="row">
            <div class="col-md-12">

                <div class="panel panel-bordered">

                    <div class="panel-heading">
                        <h3 class="panel-title">公司公告</h3>
                    </div>
                    <!-- /.box-header -->
                    <!-- form start -->
                    <form role="form" class="form-horizontal"
                          action="{{ route('admin.company.edit') }}"
                          method="POST">
                        <!-- CSRF TOKEN -->
                        {{ csrf_field() }}
                        <div class="panel-body">
                            @if (count($errors) > 0)
                                <div class="alert alert-danger">
                                    <ul>
                                        @foreach ($errors->all() as $error)
                                            <li>{{ $error }}</li>
                                        @endforeach
                                    </ul>
                                </div>
                            @endif
                            <div class="form-group">
                                <div class="">
                                    <textarea class="form-control" name="title"
                                        placeholder="公司公告" id="title"
                                        value="">@if (isset($announcement->title)){{$announcement->title}}@endif</textarea>
                                </div>
                                <input type="hidden" name="title_type" value="公司公告">
                            </div>
                        </div><!-- panel-body -->
                        <div class="panel-footer">
                            <button type="submit" onclick="return check()" class="btn btn-primary">提交</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    @stop
    @section('javascript')
    <script>
        $('document').ready(function () {
            $('.toggleswitch').bootstrapToggle();
        });
    </script>
    <script>
        function check() {
            var title = $("#title").val();
            if (title.trim() == '') {
                toastr.error("公司公告不能为空");
                return false;
            }
        }

        </script>
    <script src="/js/tinymce.min.js"></script>
    <script src="/js/voyager_tinymce.js"></script>
@stop
